home *** CD-ROM | disk | FTP | other *** search
- Path: esb.bbn.com!user
- From: rshapiro@bbn.com (R Shapiro)
- Newsgroups: comp.sys.mac.programmer.codewarrior,comp.lang.c++
- Subject: Re: templatized pointers to member functions (in CW8)
- Date: Thu, 01 Feb 1996 15:30:49 -0500
- Organization: BBN
- Message-ID: <rshapiro-0102961530500001@esb.bbn.com>
- References: <rshapiro-0102960833080001@ipa.bbn.com> <4er2af$nna@newsroom.hitc.com>
- NNTP-Posting-Host: esb.bbn.com
-
- In article <4er2af$nna@newsroom.hitc.com>, psand@eos.hitc.com (G. Patrick
- Sand) wrote:
-
- >>template <class OBJECT>
- >>class Test {
- >> // (a) This is what I want but it won't compile in CodeWarrior 8:
- >> //typedef void (OBJECT::*ObjectMemberFunction)(void);
- >>
- >> // (b) This works but isn't what I want:
- >> typedef void (ATest::*ObjectMemberFunction)(void);
- >>
- >[snip!]
- >>};
- >
- >I think the answer is NO. A template is a cookie cutter for whatever you
- >specify, but it doesn't assume any knowledge about what you specify
- >beyond whether it is a class template or a function template.
-
-
- I'm not asking it to. I just want it to substitute the real class name for
- OBJECT in:
-
- typedef void (OBJECT::*ObjectMemberFunction)(void);
-
- just as it does with all other references to OBJECT within the template.
-
-
- VisualC++ 4.0 does this successfully, by the way.
-
- --
- rs/rshapiro@bbn.com
-